define(function(require, exports, module) {
	'use strict';
	var $ = require('$'),
        app = require("dist/application/app"),
        config = app.config,
        method = app.method;

    $(document).on("blur",".js_blur",function(){
        var path = $(this).data("path"), val = $(this).val();
        var $js_name = $(this).closest(".js_group").find(".js_name");
        var $js_error = $(this).closest(".js_group").find(".js_error");
        if(val !=""){
            $.ajax({
                type:"post",
                url:path,
                data: val,
                dataType:"json"
            }).done(function(d){
                if(d.status == 0){
                    $js_name.val(d.message);
                    $js_error.html("");
                }else{
                    $js_error.html(d.error);
                    $js_name.val("");
                }
            }).fail(function() {
                window.msg.info("网络异常请重试")
            });
        }else{
            $js_name.val("");
        }
    });
});